<!--
 * @Descripttion: 
 * @Author: voanit
 * @Date: 2022-08-31 09:57:20
 * @LastEditors: voanit
 * @LastEditTime: 2022-08-31 10:24:02
-->
<script setup>
/* v2
props:{
  app:{
    type:String
  }
} */
defineProps({
  app: {
    type: String
  },
  app2: {
    type: String
  }
})

/* v2   this.$emit(触发一个事件名,传的值) */
// defineEmits([])   this.$emit===emit
const emit = defineEmits(['handleSon', 'handleSon2'])
const btn = () => {
  emit('handleSon', '我是son组件')
}

const btn2 = () => {
  emit('handleSon2')
}
</script>
<template>
  <div>
    御剑乘风来,除魔天地间!===vue3===son==={{ app }}==={{ app2 }}
    <button @click="btn">子传父</button>
    <button @click="btn2">子传父2</button>
  </div>
</template>
<style lang='less'  scoped>
</style>